﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

using Juzzbott.Ulib;

namespace Juzzbott.Ulib.Web
{
	public class UmbracoPage : System.Web.UI.MasterPage
	{

		/// <summary>
		/// Gets the current node.
		/// </summary>
		public UmbracoNode CurrentNode
		{
			get
			{
				return UmbracoNode.GetNode(umbraco.NodeFactory.Node.GetCurrent());
			}
		}

		protected override void OnInit(EventArgs e)
		{

			// If there is a redirect url set, then redirect to that url.
			if (!String.IsNullOrEmpty(CurrentNode.RedirectUrl))
			{
				Response.Redirect(CurrentNode.RedirectUrl);
			}

			// Continue loading the base page.
			base.OnInit(e);
		}


	}
}
